﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using YNTK.System.Entitys.Resources;

namespace YNTK.System.Interfaces.Resources
{
    /// <summary>
    /// 字典服务
    /// 版 本：V1.0.0.0.0
    /// 版 权：云南通科科技有限公司（https://www.yntkkj.com）
    /// 作 者：李仕鹏
    /// 日 期：2022.10.02 
    /// </summary>
    public interface IDictionaryService
    {
        /// <summary>
        /// 根据id获取字典值
        /// </summary>
        /// <param name="id">id</param>
        /// <returns></returns>
        Task<DictionaryEntity> GetDictionaryInfoAsync(string id);

        /// <summary>
        /// 根据条件获取字典数据
        /// </summary>
        /// <param name="where">条件</param>
        /// <returns></returns>
        Task<List<DictionaryEntity>> GetDictionaryListAsync(Expression<Func<DictionaryEntity, bool>> where);

        /// <summary>
        /// 根据字典值id集合获取字典值数据
        /// </summary>
        /// <param name="ids">字典值id集合</param>
        /// <returns></returns>
        Task<List<DictionaryEntity>> GetDictionaryListByIds(List<string> ids);

        /// <summary>
        /// 处理字典值id拼接上所有父级id
        /// </summary>
        /// <param name="id">字典值id</param>
        /// <param name="organizeId">组织id</param>
        /// <returns></returns>
        Task<string> GetIdAsync(string id, string organizeId);

        /// <summary>
        /// 处理字典值id拼接上所有父级id
        /// </summary>
        /// <param name="id">字典值id</param>
        /// <param name="data">字典值数据</param>
        /// <returns></returns>
        string GetId(string id, List<DictionaryEntity> data);
    }
}
